count number of spaces in a string